package api

import (
	"gitee.com/go-mid/booter/bootservice"
	"gitee.com/go-mid/booter/web"
	"gitee.com/go-mid/usercenter/usercentercontroller"
)

func RegisterUsercenterHttpServer(serv *bootservice.HttpServer, preInterceptors []bootservice.HandlerFunc, postInterceptors []bootservice.HandlerFunc) {
	//取登录用户基本信息
	serv.POST("/user/base-info", WithInterceptor(web.HttpRequestMarshalBodyWrapper(usercentercontroller.FactoryUserBaseInfoRequest), preInterceptors, postInterceptors)...)
	//dapp登录获取nonce
	serv.POST("/user/dapp/nonce", WithInterceptor(web.HttpRequestMarshalBodyWrapper(usercentercontroller.FactoryDappNonceRequest), preInterceptors, postInterceptors)...)
	//dapp执行注册登录
	serv.POST("/user/dapp/register-login", WithInterceptor(web.HttpRequestMarshalBodyWrapper(usercentercontroller.FactoryDappLoginRegisterRequest), preInterceptors, postInterceptors)...)
	//修改用户属性
	serv.POST("/user/attrs/upsert", WithInterceptor(web.HttpRequestMarshalBodyWrapper(usercentercontroller.FactoryUpsertUserAttrRequest), preInterceptors, postInterceptors)...)
}
